<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="${pageContext.request.contextPath}/">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>作业历史</title>
<style>
	small{
		color:red;
	}
	form{
		text-align:center;
		padding: 50px 10px;
	}
</style>
</head>
<body>
<form action="list?isupload=yes" method="post" enctype="multipart/form-data" onsubmit="return myCheck()">
	<input type="file" id="file" name="homework">
	<marquee direction="left">
		<small>请上传包含“总结”和“代码”的zip压缩文件！</small>
	</marquee>
	<marquee direction="right"><input type="submit" value="提交"></marquee>
</form>
<script type="text/javascript">
function myCheck(){ 
	var obj = document.getElementById("file");
    if (obj.value == "") {    
        alert("请选择文件上传！");    
        return false;    
    } else {    
        if (!/\.(zip)$/.test(obj.value)) {    
            alert("只能上传ZIP文件");    
            obj.value = "";    
            return false;    
        }    
    }    
    return true;    
} 
</script>
</body>
</html>